#!/bin/bash
#
# Target setup for keyholder

set -euxo pipefail

PACKAGES=(
  git
  vim
)

apt-get -y update
apt-get -y install "${PACKAGES[@]}"

if ! grep -q '192.168.122.1' /etc/ssh/ssh_known_hosts; then
  echo 'Authorizing master SSH host key'
  ssh-keyscan -H 192.168.122.1 >> /etc/ssh/ssh_known_hosts 2> /dev/null
fi
